<?php
defined('SYS_RUN') or exit();

class Compress {

    public function compressCss($content) {
        return $this->_compress($content);
    }

    public function compressJs($content) {
        return $this->_compress($content);
    }

    private function _compress($content) {
        $content = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $content);
        // Remove space after colons
        $content = str_replace(': ', ':', $content);
        // Remove whitespace
        return str_replace(array("\r\n", "\r", "\n", "\t", '  ', '    ', '    '), '', $content);
    }
}